import 'package:fate_blind_box/theme/theme_color.dart';
import 'package:fate_blind_box/ui/login/personinformation/personinformation_one.dart';
import 'package:flutter/material.dart';

import '../../../utils/page.dart';

class IsRegisterDialog extends Dialog {
  const IsRegisterDialog({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Container(
            width: 270,
            height: 160,
            padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 18),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(10.0),
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Image.asset(
                  'images/person_tixing.png',
                  width: 20,
                  height: 20,
                  fit: BoxFit.cover,
                ),
                const Text(
                  '此微信没有注册都肆商圈，是否继续注册登陆，或者换其他已有账号登录',
                  style: TextStyle(
                      fontSize: 14,
                      color: Color(0xFF3D3D3D),
                      fontWeight: FontWeight.w500),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    GestureDetector(
                      onTap: () {
                        Navigator.pop(context);
                        Navigate.toPage(const PersonInformationPage());
                        // Navigate.toPage(const ProfileCompleteV3Ui());
                      },
                      child: Container(
                        width: 112,
                        height: 33,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5.0),
                          border:
                              Border.all(width: 1, color: ThemeColor.appColor),
                        ),
                        alignment: Alignment.center,
                        child: Text(
                          '继续',
                          style: TextStyle(
                              fontSize: 16,
                              color: ThemeColor.appColor,
                              fontWeight: FontWeight.w500),
                        ),
                      ),
                    ),
                    GestureDetector(
                      onTap: () {
                        Navigator.pop(context);
                      },
                      child: Container(
                        width: 112,
                        height: 33,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5.0),
                          color: ThemeColor.appColor,
                        ),
                        alignment: Alignment.center,
                        child: const Text(
                          '切换',
                          style: TextStyle(
                              fontSize: 16,
                              color: Colors.white,
                              fontWeight: FontWeight.w500),
                        ),
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ),
          const SizedBox(
            height: 20,
          ),
          GestureDetector(
            onTap: () {
              Navigator.pop(context);
            },
            child: Image.asset(
              'images/ic_closeM.png',
              width: 24,
              height: 24,
              fit: BoxFit.cover,
            ),
          ),
        ],
      ),
    );
  }

  static showIsRegisterDialog(BuildContext context) {
    return showDialog(
        context: context,
        // barrierColor: Colors.black54,
        // barrierDismissible: false,
        builder: (context) {
          return const WillPopScope(
              child: IsRegisterDialog(), onWillPop: _onWillPop);
        });
  }

  static Future<bool> _onWillPop() async {
    return false;
  }
}
